﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using System.Data;


namespace CPresentacion
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {

        }

        protected void Session_Start(object sender, EventArgs e)
        {
            //crear estructura de pedido en la sesion
            
            DataTable dt = new DataTable();
            dt.Columns.Add("idProducto", Type.GetType("System.Int32"));
            dt.Columns.Add("idCantidad", Type.GetType("System.Int32"));
            dt.Columns.Add("Precio", Type.GetType("System.Double"));
            dt.Columns.Add("Nombre", Type.GetType("System.String"));
            dt.Columns.Add("Codigo", Type.GetType("System.String"));
            dt.Columns.Add("idMarca", Type.GetType("System.String"));
            dt.Columns.Add("Numero", Type.GetType("System.Int32"));
            dt.Columns.Add("Imagen", Type.GetType("System.String"));
            dt.Columns["Numero"].AutoIncrement = true;
            dt.Columns["Numero"].AutoIncrementSeed = 1;

            Session["pedido"] = dt;
        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}